package com.project.easy.common.util.enums.exception;

import com.project.easy.common.util.enums.BaseEnums;

/**
 * @author GreatorMan.cool
 * @copyright: Copyright (c) 2020
 * @company: 扬起科技有限公司
 * @date 2021/10/9 21:29
 * @description:
 */
public enum ExceptionEnums implements BaseEnums {
    SYS_EXCEPTION("300", "系统异常", 300),
    SYS_AUTH_EXCEPTION("400", "系统权限", 400),
    PARAM_ILLEGAL("500", "参数异常", 500),
    BUSINESS_EXCEPTION("700", "业务异常异常", 700),
    RETRY_EXCEPTION("-1", "重试异常", -1),
    DB_EXCEPTION("8888", "数据库异常", 8888),
    CONNECTION_EXCEPTION("9999", "资源链接异常", 8888);
    /**
     * 编码
     */
    private String code;
    /**
     * 消息
     */
    private String msg;
    /**
     * 值
     */
    private int value;

    ExceptionEnums(String code, String msg, int value) {
        this.code = code;
        this.msg = msg;
        this.value = value;
    }
    /**
     * 获取编码
     *
     * @return 编码
     */
    @Override
    public String getCode() {
        return code;
    }

    /**
     * 获取名称
     *
     * @return 名称
     */
    @Override
    public String getName() {
        return msg;
    }

    /**
     * 枚举值
     *
     * @return 枚举值
     */
    @Override
    public int getValue() {
        return value;
    }
}
